From: Florian Müllner Date: Tue, 21 Oct 2025 22:57:26 +0000 (+0200) Subject: systemActions: Don't log error when cancelled X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~160 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d3f3f4e80d338133a2083dd5c267ed456b86303d;p=gnome-shell.git systemActions: Don't log error when cancelled If the logout/reboot/shutdown actions are available, we expect them to succeed. Unfortunately that changed in the light of systemd inhibitors (that we don't know about in the shell, and that prevent those actions now). While it would be good to fix the underlying issue, we can at least improve the error reporting in that case and not log the error when the operation was cancelled: We don't know the underlying reason, unlike gnome-session which should have logged a more helpful message. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8749 Part-of: --- diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js index ae0268903..710d42fa5 100644 --- a/js/misc/systemActions.js +++ b/js/misc/systemActions.js @@ -5,6 +5,7 @@ import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; +import {logErrorUnlessCancelled} from './errorUtils.js'; import * as GnomeSession from './gnomeSession.js'; import * as LoginManager from './loginManager.js'; import * as Main from '../ui/main.js'; @@ -448,21 +449,21 @@ const SystemActions = GObject.registerClass({ throw new Error('The logout action is not available!'); Main.overview.hide(); - this._session.LogoutAsync(0).catch(logError); + this._session.LogoutAsync(0).catch(logErrorUnlessCancelled); } activatePowerOff() { if (!this._actions.get(POWER_OFF_ACTION_ID).available) throw new Error('The power-off action is not available!'); - this._session.ShutdownAsync(0).catch(logError); + this._session.ShutdownAsync(0).catch(logErrorUnlessCancelled); } activateRestart() { if (!this._actions.get(RESTART_ACTION_ID).available) throw new Error('The restart action is not available!'); - this._session.RebootAsync().catch(logError); + this._session.RebootAsync().catch(logErrorUnlessCancelled); } activateSuspend() {